package com.kvest.scanrecognizer.datamodel;

/**
 * Created with IntelliJ IDEA.
 * User: Kvest
 * Date: 14.09.13
 * Time: 21:59
 * To change this template use File | Settings | File Templates.
 */
public enum RecognizeStatus {
    IN_QUEUE (0),
    IN_PROGRESS (1),
    DONE (3),
    ERROR (4);

    private int value;

    private RecognizeStatus(int value) {
        this.value = value;
    }

    public int getInt() {
        return value;
    }

    public static RecognizeStatus convert(int code) {
        switch (code) {
            case 0: return IN_QUEUE;
            case 1: return IN_PROGRESS;
            case 3: return DONE;
            case 4: return ERROR;
            default: return ERROR;
        }
    }
}
